package cn.wegoteam.shop.po;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * Adress entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "address", catalog = "shop")
public class Address extends BasePo implements java.io.Serializable {
	// Fields
	private Integer id;
	private User user;
	private String subarea;// 所在地区
	private String detailAddress;//详细地址
	private String postcode;// 收货地址邮编
    private String accepter;//收货人
    private String phone;//电话号码
    private String telephone;//手机号码
    private String def;
    private int flag;
	// Constructors
    @Column(name="def",length=2)
	public String getDef() {
		return def;
	}
	public void setDef(String def) {
		this.def = def;
	}
	/** default constructor */
	public Address() {
	}

	

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "uid",nullable = false)
	public User getUser() {
		return this.user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	@Column(name = "subarea", length = 100)
	public String getSubarea() {
		return this.subarea;
	}

	public void setSubarea(String Subarea) {
		this.subarea = Subarea;
	}
	@Column(name = "postcode", length = 32)
	public String getPostcode() {
		return this.postcode;
	}

	public void setPostcode(String postcode) {
		this.postcode = postcode;
	}
    @Column(name="accepter",length=32)
	public String getAccepter() {
		return accepter;
	}

	public void setAccepter(String accepter) {
		this.accepter = accepter;
	}
    @Column(name="phone",length=32)
	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}
    @Column(name="detailAddress",length=120)
	public String getDetailAddress() {
		return detailAddress;
	}

	public void setDetailAddress(String detailAddress) {
		this.detailAddress = detailAddress;
	}
    @Column(name="telephone",length=12)
	public String getTelephone() {
		return telephone;
	}

	public void setTelephone(String telephone) {
		this.telephone = telephone;
	}
	@Column(name="flag",insertable=false,nullable=false)
	public Integer getFlag() {
		return flag;
	}
	public void setFlag(int flag) {
		this.flag = flag;
	}
   
}